package com.zhkj.crawl.entity;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class ResultAmzForPush {
    private long id;
    private String asin;
    private String site;
    private String rank_str;
    private int rank1;
    private int rank2;
    private int rank3;
    private int review;
    private String star;
    private String url;
    private long grab_time;

    public void setGrab_time(long grab_time) {
        this.grab_time = grab_time / 1000;
    }

    public void setRank1(Integer rank1) {
        this.rank1 = rank1 == null ? 0 : rank1;
    }

    public void setRank2(Integer rank2) {
        this.rank2 = rank2 == null ? 0 : rank2;
    }

    public void setRank3(Integer rank3) {
        this.rank3 = rank3 == null ? 0 : rank3;
    }

    public void setReview(Integer review) {
        this.review = review == null ? 0 : review;
    }

    public void setStar(BigDecimal star) {
        this.star = star == null ? "0.0" : star.toString();
    }
}
